package com.example.service;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;

/**
 * Description
 * ...
 * DATE 2017/11/15.
 *
 * @author Mr. Chun.
 */
@Component
public class Consumer {

    @JmsListener(destination = "com_xxx_question_change_status.queue")
    @SendTo("com_xxx_question_change_status_out.queue")
    public String receiveQueue(String message) throws InterruptedException {
        Thread.sleep(5000);
        message = "Consumer收到消息：" + message;
        System.out.println(message);
        return message;
    }
}
